<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>文字的对齐系列</title>
  <style>
    div {
      text-align: center;
    }

    p {
      text-align: right;
    }
  </style>
</head>

<body>
  <div>这是要一段文本</div>
  <p>这也是一段文本</p>
</body>

</html>